#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <ctype.h>
#include <iomanip>
#include <queue>
#include <stdlib.h>
using namespace std;

int f[10000010], num[10000010];
int n, m;

void init()
{
    for (int i = 0; i <= 10000010; i++)
    {
        f[i] = i;
        num[i] = 1;
    }
}

int find(int x)
{
    if (x != f[x])
        f[x] = find(f[x]);
    return f[x];
}

void Union(int x, int y)
{
    int p = find(x);
    int q = find(y);
    if (p != q)
    {
        f[p] = q;
        num[q] += num[p];
    }
}

int main()
{
    int n, m, i, j, a, b;
    while (~scanf("%d", &n))
    {
        if (n == 0)
        {
            printf("1\n");
            continue;
        }
        init();
        int max = 0;
        for (i = 0; i < n; i++)
        {
            scanf("%d%d", &a, &b);
            Union(a, b);
        }
        for (j = 0; j <= 10000010; j++)
        {
            if (num[j] > max)
                max = num[j];
        }
        printf("%d\n", max);
    }
}

// https://www.cnblogs.com/wangmengmeng/p/4957418.html